package cmdb_info

import (
	"encoding/json"
	"log"
	"io"
	"net/http"
)

func GetUrl(url string) (*map[string]interface{}, error) {
	var retData map[string]interface{}
	response, err := http.Get(url)
	if err != nil {
		log.Println("Error making GET request:", err)
		return nil, err
	}
	defer response.Body.Close()

	// Read the response body
	body, err := io.ReadAll(response.Body)
	if err != nil {
		log.Println("Error reading response body:", err)
		return nil, err
	}
	// Parse the JSON response
	err = json.Unmarshal(body, &retData)
	return &retData, err
}
